import commonjs from "@rollup/plugin-commonjs";
import { babel } from "@rollup/plugin-babel";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import { terser } from "rollup-plugin-terser";
export default {
  input: "src/main.ts",
  output: [
    {
      file: "lib/index.cjs.js",
      format: "cjs",
      exports: "auto",
    },
    {
      file: "lib/index.cjs.min.js",
      format: "cjs",
      exports: "auto",
      plugins: [terser()],
    },
    {
      file: "lib/index.esm.min.js",
      format: "esm",
      exports: "auto",
      plugins: [terser()],
    },
  ],
  external: ["@dcloudio/uni-cli-shared"],
  plugins: [
    typescript({ tsconfig: "./tsconfig.json" }),
    commonjs(),
    babel({ babelHelpers: "bundled" }),
    nodeResolve(),
  ],
};
